/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * PnlListUnit.java
 *
 * Created on 27 ม.ค. 2553, 11:51:11
 */

package warehouse;

/**
 *
 * @author Administrator
 */
public class PnlListUnit extends javax.swing.JPanel {

    /** Creates new form PnlListUnit */
    public PnlListUnit() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pnlHeadListUnit = new javax.swing.JPanel();
        lblHeadListUnit = new javax.swing.JLabel();
        btnUnListSearch = new javax.swing.JButton();
        btnUnListAdd = new javax.swing.JButton();
        btnUnListDel = new javax.swing.JButton();
        btnUnListEdit = new javax.swing.JButton();
        btnUnPrint = new javax.swing.JButton();
        pnlListUnit = new javax.swing.JPanel();
        lblUnCode = new javax.swing.JLabel();
        txtUnCode = new javax.swing.JTextField();
        lblUnName = new javax.swing.JLabel();
        txtUnName = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        tblListUnit = new javax.swing.JTable();

        setMaximumSize(new java.awt.Dimension(700, 500));
        setMinimumSize(new java.awt.Dimension(700, 500));
        setPreferredSize(new java.awt.Dimension(700, 500));
        setLayout(new java.awt.BorderLayout());

        pnlHeadListUnit.setBackground(new java.awt.Color(204, 255, 204));
        pnlHeadListUnit.setMaximumSize(new java.awt.Dimension(700, 80));
        pnlHeadListUnit.setMinimumSize(new java.awt.Dimension(700, 80));
        pnlHeadListUnit.setPreferredSize(new java.awt.Dimension(700, 80));

        lblHeadListUnit.setFont(new java.awt.Font("Tahoma", 1, 16));
        lblHeadListUnit.setText("จัดการหน่วยสินค้า");

        btnUnListSearch.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/search_30x30.gif"))); // NOI18N

        btnUnListAdd.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/add_30x30.gif"))); // NOI18N

        btnUnListDel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/del_30x30.gif"))); // NOI18N

        btnUnListEdit.setFont(new java.awt.Font("Tahoma", 0, 14));
        btnUnListEdit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/edit1_30x30.gif"))); // NOI18N
        btnUnListEdit.setMaximumSize(new java.awt.Dimension(75, 30));
        btnUnListEdit.setMinimumSize(new java.awt.Dimension(75, 30));
        btnUnListEdit.setPreferredSize(new java.awt.Dimension(75, 30));

        btnUnPrint.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/print_30x30.gif"))); // NOI18N
        btnUnPrint.setMaximumSize(new java.awt.Dimension(40, 40));
        btnUnPrint.setMinimumSize(new java.awt.Dimension(40, 40));
        btnUnPrint.setPreferredSize(new java.awt.Dimension(40, 40));

        javax.swing.GroupLayout pnlHeadListUnitLayout = new javax.swing.GroupLayout(pnlHeadListUnit);
        pnlHeadListUnit.setLayout(pnlHeadListUnitLayout);
        pnlHeadListUnitLayout.setHorizontalGroup(
            pnlHeadListUnitLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlHeadListUnitLayout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addGroup(pnlHeadListUnitLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblHeadListUnit)
                    .addGroup(pnlHeadListUnitLayout.createSequentialGroup()
                        .addComponent(btnUnListSearch, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnUnListAdd, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnUnListDel, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnUnListEdit, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnUnPrint, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(440, Short.MAX_VALUE))
        );
        pnlHeadListUnitLayout.setVerticalGroup(
            pnlHeadListUnitLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlHeadListUnitLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addGroup(pnlHeadListUnitLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(btnUnPrint, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(pnlHeadListUnitLayout.createSequentialGroup()
                        .addComponent(lblHeadListUnit)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlHeadListUnitLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(btnUnListSearch, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(btnUnListAdd, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(btnUnListDel, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(btnUnListEdit, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );

        add(pnlHeadListUnit, java.awt.BorderLayout.PAGE_START);

        pnlListUnit.setMaximumSize(new java.awt.Dimension(700, 32767));
        pnlListUnit.setMinimumSize(new java.awt.Dimension(700, 100));

        lblUnCode.setFont(new java.awt.Font("Tahoma", 0, 12));
        lblUnCode.setText("รหัสหน่วยนับสินค้า :");

        txtUnCode.setFont(new java.awt.Font("Tahoma", 0, 12));
        txtUnCode.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtUnCodeActionPerformed(evt);
            }
        });

        lblUnName.setFont(new java.awt.Font("Tahoma", 0, 12));
        lblUnName.setText("หน่วยนับสินค้า :");

        txtUnName.setFont(new java.awt.Font("Tahoma", 0, 12));
        txtUnName.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtUnNameActionPerformed(evt);
            }
        });

        tblListUnit.setFont(new java.awt.Font("Tahoma", 0, 12));
        tblListUnit.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "รหัสหน่วยนับสินค้า", "หน่วยนับสินค้า"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane1.setViewportView(tblListUnit);

        javax.swing.GroupLayout pnlListUnitLayout = new javax.swing.GroupLayout(pnlListUnit);
        pnlListUnit.setLayout(pnlListUnitLayout);
        pnlListUnitLayout.setHorizontalGroup(
            pnlListUnitLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlListUnitLayout.createSequentialGroup()
                .addGroup(pnlListUnitLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlListUnitLayout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addComponent(lblUnCode)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txtUnCode, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(lblUnName)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txtUnName, javax.swing.GroupLayout.PREFERRED_SIZE, 217, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(pnlListUnitLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 680, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        pnlListUnitLayout.setVerticalGroup(
            pnlListUnitLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlListUnitLayout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addGroup(pnlListUnitLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblUnCode)
                    .addComponent(txtUnCode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblUnName)
                    .addComponent(txtUnName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 171, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(197, Short.MAX_VALUE))
        );

        add(pnlListUnit, java.awt.BorderLayout.CENTER);
    }// </editor-fold>//GEN-END:initComponents

    private void txtUnCodeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtUnCodeActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_txtUnCodeActionPerformed

    private void txtUnNameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtUnNameActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_txtUnNameActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnUnListAdd;
    private javax.swing.JButton btnUnListDel;
    private javax.swing.JButton btnUnListEdit;
    private javax.swing.JButton btnUnListSearch;
    private javax.swing.JButton btnUnPrint;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel lblHeadListUnit;
    private javax.swing.JLabel lblUnCode;
    private javax.swing.JLabel lblUnName;
    private javax.swing.JPanel pnlHeadListUnit;
    private javax.swing.JPanel pnlListUnit;
    private javax.swing.JTable tblListUnit;
    private javax.swing.JTextField txtUnCode;
    private javax.swing.JTextField txtUnName;
    // End of variables declaration//GEN-END:variables

}
